home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / assembly / asm68xx.001 < prev    next >
Text File  |  1996-11-16  |  4KB  |  168 lines

  1. #!/bin/bash
  2. #
  3. # briefme - top package agent. Copyright (c) 1993 (Gil Nardo)
  4. #    see files in subdir ..asm68xx/legal for legalease
  5.  
  6. _briefme()
  7. {
  8. #
  9. # README starts here
  10. #
  11.  
  12. more <<-TOHERE
  13.  
  14.     This is the top level directory for the 68xx assemblers
  15.     and utilities.  The programs made from this package are
  16.     used to generate Motorola 68xx microcomputer instructions
  17.     for programming the MC6800 chip family. This chip family
  18.     is usually used in embedded computer applications. The output
  19.     files can be sent to an eprom or chip programmer device that
  20.     accepts Motorola S records or binary images.
  21.  
  22.     The raw public domain sources were originally from the Motorola
  23.     BBS and has been ported, packaged, and made available by
  24.     Migrant Computing Services for the benefit of the Linux community.
  25.  
  26.     The README file doubles as both a README and an Bash executable
  27.     package agent -- a program that helps navigate, explain, and
  28.     maintain parts of a software package. { Package Agent (tm) :-) }
  29.  
  30.     For those who do not have the command shell 'Bash', or have
  31.     trouble using this script, or wish to go straight to using
  32.     the package, here are the manual directions to follow to get
  33.     you going, ASAP.
  34.  
  35.     1) cd to ..../src.utl
  36.     2) validate or modify makefile defines for your system tools
  37.     3) execute make
  38.     4) cd to ..../src.asm
  39.     5) validate or modify makefile defines for your system tools
  40.     6) execute make
  41.     7) cd to ..../tests
  42.     8) execute make
  43.     9) if the tests pass, you are ready to use and install the
  44.          files ..../bin/as* to a system directory.
  45.  
  46.  
  47.     The files located at this level are
  48.  
  49.     README*        readable bash executable package agent
  50.     briefme*    bash executable package agent
  51.  
  52.     The subdirectories visible from this level are
  53.  
  54.     src.asm/    source code to assembler
  55.     src.utl/    source code to utilities
  56.     inc/        local include directory
  57.     bin/        container for package targets
  58.     tests/        test area for package executables
  59.     agents/        contains utilities for package agents
  60.     doc/        holds technical sorts of documents
  61.     legal/        holds legal sorts of documents
  62.  
  63. TOHERE
  64.  
  65. #
  66. # README ends here
  67. #
  68.  
  69. }
  70.  
  71.  
  72.  
  73.  
  74. # Prompt for yes or no answer - returns non-zero for no
  75. _getyn()
  76. {
  77.         while   echo -n "$* (y/n) ">&2
  78.         do      read yn rest
  79.                 case $yn in
  80.                 [yY])   return 0                      ;;
  81.                 [nN])   return 1                      ;;
  82.                 *)      echo "Please answer y or n" >&2 ;;
  83.                 esac
  84.         done
  85. }
  86.  
  87. # look for an archive sitting with the README file
  88. _check_archive()
  89. {
  90.     local ARCNAME
  91.     local ARCPLACE
  92.  
  93.     ARCNAME=$1
  94.  
  95.     if [ ! -f $ARCNAME ]
  96.     then return
  97.     fi
  98.  
  99.     echo Archive file ${ARCNAME} is available
  100.  
  101.     case $ARCNAME in
  102.  
  103.         *.taz)
  104.             if (_getyn "Extract files from gzipped tar?")
  105.             then
  106.                 tar -zxvf $ARCNAME
  107.             fi
  108.             ;;
  109.  
  110.         *.tgz | *.tpz)
  111.             if (_getyn "Reverse gzip then extract from tar?")
  112.             then
  113.                 gunzip < $ARCNAME | tar -xvf -
  114.             fi
  115.             ;;
  116.  
  117.         *.tar)
  118.             if (_getyn "Extract files from tar?")
  119.             then
  120.                 tar xvf $ARCNAME
  121.             fi
  122.             ;;
  123.  
  124.         *)
  125.             echo Dont know how to handle archive file $ARCNAME
  126.             return
  127.             ;;
  128.     esac
  129.  
  130.     ARCPLACE=archive
  131.  
  132.     if (_getyn "Move $ARCNAME to directory $ARCPLACE?")
  133.     then
  134.         if [ ! -d  $ARCPLACE ]
  135.         then
  136.             mkdir $ARCPLACE
  137.         fi
  138.         if [ ! -d $ARCPLACE ]
  139.         then
  140.             echo Could not create $ARCPLACE directory
  141.             return
  142.         fi
  143.         mv $ARCNAME $ARCPLACE
  144.     fi
  145.  
  146. }
  147.  
  148. #
  149. # main()
  150. #
  151.     QUICKLY=$1
  152.  
  153.     _briefme
  154.  
  155.     if [ -z "$BASH_VERSION" ]
  156.     then
  157.         echo "I want to be bash'd!"
  158.         _getyn "Continue running in this shell anyway?" || exit
  159.     fi
  160.  
  161.     _check_archive `echo *.tgz`
  162.  
  163.     if [ ! -z "$QUICKLY" ]
  164.     then exit
  165.     fi
  166.  
  167.     ./briefme
  168.